package com.hellobike.haxing.modules.coupon.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.hellobike.haxing.modules.product.mapper.typehandler.JSONObjectHandler;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.hellobike.haxing.common.annotation.Dict;

/**
 * @Description: 优惠券
 * @Author: haxing-boot
 * @Date: 2020-02-01
 * @Version: V1.0
 */
@Data
@TableName(value = "t_coupon", autoResultMap = true)
public class Coupon implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 名称
     */
    @Excel(name = "名称", width = 15)
    private String name;
    /**
     * 面值
     */
    @Excel(name = "面值", width = 15)
    private BigDecimal faceValue;
    /**
     * 最大发行数
     */
    @Excel(name = "最大发行数", width = 15)
    private Integer maxNum;
    /**
     * 券时效规则
     */
    @Excel(name = "券时效规则", width = 15)
    @TableField(typeHandler = JSONObjectHandler.class)
    private JSONObject timeLimitRule;
    /**
     * 用券应满金额
     */
    @Excel(name = "用券应满金额", width = 15)
    private BigDecimal requireAmount;
    /**
     * 用户范围
     */
    @Excel(name = "用户范围：0-全部 1-新用户 2-老用户", width = 15)
    private Integer userRange;
    /**
     * 用户最大领取数
     */
    @Excel(name = "用户最大领取数", width = 15)
    private Integer userClaimLimit;
    /**
     * 站点范围
     */
    @Excel(name = "站点范围", width = 15)
    @TableField(typeHandler = JSONObjectHandler.class)
    private JSONObject siteRange;
    /**
     * 商品范围
     */
    @Excel(name = "商品范围", width = 15)
    @TableField(typeHandler = JSONObjectHandler.class)
    private JSONObject productRange;
    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 修改时间
     */
    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建人
     */
    @Excel(name = "创建人", width = 15)
    private Long createBy;
    /**
     * 修改人
     */
    @Excel(name = "修改人", width = 15)
    private Long updateBy;
    /**
     * 是否删除：0-否 1-是
     */
    @Excel(name = "是否删除：0-否 1-是", width = 15)
    @TableLogic
    private Integer deleted;
}
